package controller.factory;

import java.util.ArrayList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import util.Utils;
import model.Statechart;
import model.StatechartComponent;
import model.User;

public class StatechartFactory {

	private static final Logger log = LoggerFactory
			.getLogger(StatechartFactory.class);
	
	private final static StatechartFactory instance = new StatechartFactory();

	public final static StatechartFactory instance() {
		return instance;
	}

	public Statechart createStatechart(String name, User user) {
		log.debug("Creating statechart");
		return new Statechart(getUniqueID(), user, name, new ArrayList<StatechartComponent>());
	}

	private Long getUniqueID() {
		return Utils.getUID();
	}

}
